(:: pragma bea:global-element-parameter parameter="$offerCheck1" element="ns1:offerCheck" location="../WSDLs/offerCheck.wsdl" ::)
(:: pragma bea:global-element-return element="ns0:ConfigurationCheck" location="../WSDLs/ConfigurationCheck.wsdl" ::)

declare namespace ns1 = "http://www.example.org/offerCheck/";
declare namespace ns0 = "http://www.example.org/ConfigurationCheck/";
declare namespace xf = "http://tempuri.org/ActivateNewCustomer/Transformation/inputToConfigurationCheck/";

declare function xf:inputToConfigurationCheck($offerCheck1 as element(ns1:offerCheck))
    as element(ns0:ConfigurationCheck) {
        <ns0:ConfigurationCheck>
            <mvnoID>{ data($offerCheck1/mvnoID) }</mvnoID>
            <realm>{ data($offerCheck1/realm) }</realm>
            <clearwireMarketID>{ data($offerCheck1/clearwireMarketID) }</clearwireMarketID>
            {
                for $SKU in $offerCheck1/SKU
                return
                    <SKU>{ data($SKU) }</SKU>
            }
            <offerId>{ data($offerCheck1/offerId) }</offerId>
            {
                for $lbsType in $offerCheck1/lbsType
                return
                    <lbsType>{ data($lbsType) }</lbsType>
            }
            {
                for $mvnoReferenceNumber in $offerCheck1/mvnoReferenceNumber
                return
                    <mvnoReferenceNumber>{ data($mvnoReferenceNumber) }</mvnoReferenceNumber>
            }
            {
                for $customer_id in $offerCheck1/customer_id
                return
                    <customer_id>{ data($customer_id) }</customer_id>
            }
            {
                for $service_id in $offerCheck1/service_id
                return
                    <service_id>{ data($service_id) }</service_id>
            }
            {
                for $mvnoMarketID in $offerCheck1/mvnoMarketID
                return
                    <mvnoMarketID>{ data($mvnoMarketID) }</mvnoMarketID>
            }
            {
                for $macID in $offerCheck1/macID
                return
                    <macID>{ data($macID) }</macID>
            }
        </ns0:ConfigurationCheck>
};

declare variable $offerCheck1 as element(ns1:offerCheck) external;

xf:inputToConfigurationCheck($offerCheck1)